from PyQt4.QtGui import QDialog, QDialogButtonBox, QLineEdit
from PyQt4.QtGui import QVBoxLayout
from PyQt4.QtCore import SIGNAL

from views.widgets.inputWidget import InputBox
from views.widgets.pushButton import PushButton


class ResetPasswordView(QDialog):
    def __init__(self, parent=None):
        super(ResetPasswordView, self).__init__(parent)
        # data
        self.setWindowTitle('Reset Password')
        # widget
        self.nameInput = InputBox('username:        ')
        self.oldPasswordInput = InputBox('old password:    ')
        self.newPasswordInput = InputBox('new password:    ')
        self.confirmPasswordInput = InputBox('confirm password:')
        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        # password input
        self.oldPasswordInput.edit.setEchoMode(QLineEdit.Password)
        self.newPasswordInput.edit.setEchoMode(QLineEdit.Password)
        self.confirmPasswordInput.edit.setEchoMode(QLineEdit.Password)
        # Layout
        self.mainLayout = QVBoxLayout()
        self.mainLayout.addLayout(self.nameInput)
        self.mainLayout.addLayout(self.oldPasswordInput)
        self.mainLayout.addLayout(self.newPasswordInput)
        self.mainLayout.addLayout(self.confirmPasswordInput)
        self.mainLayout.addWidget(self.buttonBox)
        self.setLayout(self.mainLayout)
